import service from '../utils/request.js'; // 引入二次封装的 axios

// 活动管理（管理端）
export const addActivity = (activity) => {
    return service.post('/api/admin/activity/add', activity);
};

export const deleteActivityById = (id) => {
    return service.post(`/api/admin/activity/delete/${id}`);
};

export const getActivityById = (id) => {
    return service.get(`/api/admin/activity/detail/${id}`);
};

export const listActivities = (params) => {
    return service.post('/api/admin/activity/list', params);
};

export const updateActivity = (activity) => {
    return service.post('/api/admin/activity/update', activity);
};

export const deleteActivityBatch = (its) => {
    return service.post('/api/admin/activity/batchDelete', its);
};

// 活动管理（前台）
export const listActivityLatest = () => {
    return service.get(`/api/client/activity/latestList`);
};

//列表页面
export const clientlistActivity = (params) => {
    return service.post(`/api/client/activity/list`,params);
};
export const clientgetActivityById = (id) => {
    return service.get(`/api/client/activity/detail/${id}`);
};